/*
 * IAddressModel.java
 * business
 *
 * Created by ChenTao on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.model;

import com.yidiandao.business.data.address.Area;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;

import java.util.List;

/**
 * 用户地址的Model
 */
public interface IAddressModel {

    interface OnAccessNetListener<T> {

        void onSuccess(T t);

        void onFailed();
    }

    interface OnAddressListener {
        void onSuccess(List<Area> cities);
    }

    /**
     * 刷新选择地址列表checkbox状态的Event
     */
    void postRefreshAddressListEvent();

    /**
     * 刷新地址列表的Event
     */
    void postRefreshAddressStateEvent();

    /**
     * 获取确认订单可选地址列表
     */
    void loadCartAddressList(String tag, OnAccessNetListener<List<DisplayListItem>> listener);

    void addUserAddress(
            String consignee,
            String mobile,
            int provinceId,
            int cityId,
            int areaId,
            String address,
            String tag,
            OnAccessNetListener<Object> listener);

    void updateUserAddress(
            String consignee,
            String mobile,
            String addressId,
            int provinceId,
            int cityId,
            int areaId,
            String address,
            String tag,
            OnAccessNetListener<Object> listener);

    void setDefaultAddress(String addressId, String tag, OnAccessNetListener<Object> listener);

    void loadUserAddressListWhenManager(
            String tag, OnAccessNetListener<List<DisplayListItem>> listener);

    void deleteUserAddress(String addressId, String tag, OnAccessNetListener<Object> listener);

    /**
     * 因地址改变获取host
     */
    void getAddressChangeHost(String tag, String city, OnAccessNetListener<String> listener);

    void getAreaList(String regionId, String tag, OnAddressListener listener);

    void changeAddress(String tag, String addressId, OnAccessNetListener<Object> listener);

}
